<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <title>评分指标设置</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
<div class="box box-primary" id="more" style="width:120px;height:20px;background-color:#222c32;position:absolute;z-index:9999;left:850px;top:100px;display:none;font-size:12px;border-top-color:#222c32;">
            <!-- <div class="box-header with-border">
                	更多操作
            </div> --><!-- /.box-header -->
            <div class="box-body home-message" id="moreOp">
            </div>
        </div>
    <section class="content-header">
        <h1>评分指标设置</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active">药品招标管理</li>
            <li class="active">采购项目管理</li>
            <li class="active">评分指标设置</li>
        </ol>
    </section>
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
                    <div class="form-group form-group-xs">
                	    <label for="txtDrugName">项目名称：</label>
					    <select class="form-control" style="width:220px;" id="projId" name="projId"></select>
                	</div>
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">状态：</label>
                        <select class="form-control"  id="status" name="status">
                        	<option value="">请选择</option>
                        	<option value="1">启用</option>
                        	<option value="0">停用</option>
                        </select>
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">类型：</label>
                        <select class="form-control"  id="projCat" name="projCat">
                        	<option value="">请选择</option>
                        	<option value="1">招标采购</option>
                        	<option value="2">谈判采购</option>
                        	<option value="3">定点生产</option>
                        	<option value="4">直接采购</option>
                        </select>
                    </div>
                    <button type="button" onclick="gridSerch()" class="btn btn-success btn-sm">查&nbsp;询</button>
                </div>
            </div>
        </div>

        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>

    </section>
    
    <%@ include file="/WEB-INF/component/commonJS.jsp" %>
    <script type="text/javascript">
    $(function(){
		$("#projId").HNSelect({
            url: "${pageContext.request.contextPath}/selectController/getDicBidCompany.html", data: { ID: '' }, defaultText: "<option value=''>请选择</option>",
        });
	});
    
        $(function () {
            $("#gridlist").jqGrid({
                url: "${ctx}/bidProject/getDataList.html",
                mtype: "POST",
                datatype: "json",
                autowidth: true,
                shrinkToFit:true,
                height: 270,
                colNames: ['操作','projId', '项目编号', '项目名称','评分开始日期','评分结束日期','类型', '状态'],
                colModel: [
                    { name: 'operate', width: 60, align: 'center' ,sortable: false,
	                  formatter: function (val, opts, rowdata) {
	                 	var str ="";
	                   	str += "<a href='${ctx}/bidScoreRule/toSetCompScoreRule.html?projId="+rowdata.projId+"' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -40px -60px' class='opIcon' title='企业资质指标设置'></a>";
	                 	str += "<a href='${ctx}/bidScoreRule/toSetDrugScoreRule.html?projId="+rowdata.projId+"' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -60px -60px' class='opIcon' title='药品资质指标设置'></a>";
		                str += "<a href='${ctx}/bidScoreRule/toSetSubjiecScoreRule.html?projId="+rowdata.projId+"' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -80px -60px' class='opIcon' title='主观分指标设置'></a>";
		                return str;
	                     }	  
	                },
                    { name: 'projId', key:true,hidden:true,width: 40, align: 'center' ,sortable: false},
                    { name: 'projCode', width: 120,hidden:true, align: 'center' ,sortable: false},
                    { name: 'name', width: 160, align: 'center' ,sortable: false},
                    { name: 'starttime', width: 100, align: 'center' ,sortable: false},
                    { name: 'endtime', width: 100, align: 'center' ,sortable: false},
                    { name: 'projCat', width: 100, align: 'center' ,sortable: false,
                    	formatter : function(val, opts,rowdata) {
    						if (val == 1) {
    							return "招标采购";
    						} else if (val == 2) {
    							return "谈判采购";
    						}else if (val == 3) {
    							return "定点生产";
    						}else if (val == 4) {
    							return "直接采购";
    						}
    					}},
                    { name: 'status', width: 60, align: 'center' ,sortable: false,
						formatter : function(val, opts,rowdata) {
							if (val == 1) {
								return "启用";
							} else if (val == 0) {
								return "停用";
							}
					}}
                    
                   
                ],
                //rowNum: 0,
                //rowList: [10, 20, 50, 100],
                rownumbers: true,
                //pager: "#gridpage",
                viewrecords: true,
                caption: "评分指标列表",
                jsonReader: {
                    repeatitems: false  
                },
                loadComplete: function (data) { //完成服务器请求后，回调函数
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
            //moreNoMore();
            $("#more").width(120);
        });
      //查询
        function gridSerch() {
        	var projId = $("#projId").val();
        	var status = $("#status").val();
        	var projCat = $("#projCat").val();
    		$("#gridlist").jqGrid('setGridParam',{  
    	        datatype:'json',
    	        postData:{
    	        		"projId":projId,
    	        		"status":status,
    	        		"projCat":projCat}
    	    }).trigger("reloadGrid"); //重新载入  
    	}
      
       
      
        
        
        
        
    </script>
</body>
</html>